Use Hint Bridge for Constraining HintLoad#39
Use Hint Bridge for Constraining HintLoad#39kunxian-xia merged 18 commits intofeat/v1.4.1-scroll-extfrom
HintLoad#39Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new “hint bus/bridge” mechanism to constrain values read from hint_space, and updates Native sumcheck to source inputs from hint space by default with optional witness-array writeback.
Changes:
- Add
HintBus/HintBridgeto the system port and plumb it through circuit extensions. - Update
NativeSumcheckto always read prod/logup inputs fromhint_space, make writeback optional, and add hint-bus lookups for those reads. - Introduce a
HintSpaceProviderAIR/chip intended to provide hint keys for the lookup table.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| extensions/sha256/circuit/src/sha256_chip/air.rs | Ignore new hint_bridge system port field. |
| extensions/rv32im/circuit/src/extension/mod.rs | Ignore new hint_bridge system port field in RV32 extensions. |
| extensions/native/circuit/src/sumcheck/execution.rs | Sumcheck executor now reads prod/logup evals from hint_space and gates writeback. |
| extensions/native/circuit/src/sumcheck/columns.rs | Replace is_hint_src_id with is_writeback + hint-id columns. |
| extensions/native/circuit/src/sumcheck/chip.rs | Tracegen updated for hint-space inputs, optional writeback, and hint-provider requests. |
| extensions/native/circuit/src/sumcheck/air.rs | Sumcheck AIR adds HintBridge lookups and optional writeback behavior. |
| extensions/native/circuit/src/poseidon2/air.rs | Plumb HintBridge into Native Poseidon2 AIR constructor/state. |
| extensions/native/circuit/src/lib.rs | Export new hint_space_provider module. |
| extensions/native/circuit/src/hint_space_provider.rs | New provider AIR/chip to supply (hint_id, offset, value) keys on the hint bus. |
| extensions/native/circuit/src/extension/mod.rs | Wire hint bridge/provider AIR + chip into Native extension (CPU). |
| extensions/keccak256/circuit/src/extension/mod.rs | Ignore new hint_bridge system port field. |
| extensions/ecc/circuit/src/extension/weierstrass.rs | Ignore new hint_bridge system port field. |
| extensions/bigint/circuit/src/extension/mod.rs | Ignore new hint_bridge system port field. |
| extensions/algebra/circuit/src/extension/modular.rs | Ignore new hint_bridge system port field. |
| extensions/algebra/circuit/src/extension/fp2.rs | Ignore new hint_bridge system port field. |
| crates/vm/src/system/mod.rs | Add HintBus/HintBridge to system config, inventory, and SystemPort. |
| crates/vm/src/system/memory/offline_checker/columns.rs | Add hint read/write aux column structs. |
| crates/vm/src/system/memory/offline_checker/bus.rs | Add HintBus wrapper over LookupBus. |
| crates/vm/src/system/memory/offline_checker/bridge.rs | Add HintBridge wrapper exposing lookup/provide API. |
| crates/vm/src/arch/testing/mod.rs | Reserve HINT_BUS bus index for tests. |
| crates/vm/src/arch/testing/cuda.rs | Add hint_bridge() and include it in SystemPort for GPU tests. |
| crates/vm/src/arch/testing/cpu.rs | Add hint bridge to SystemPort for CPU tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR adds CUDA/GPU support for the HintSpaceProvider periphery chip used by the new HintBridge, enabling GPU-side trace generation for the hint space provider table and registering the chip in the GPU prover extension.
| let local = main.row_slice(0); | ||
| let local: &HintSpaceProviderCols<AB::Var> = (*local).borrow(); | ||
|
|
||
| builder.assert_bool(local.is_valid); |
There was a problem hiding this comment.
You have to make sure that the tuple (hint_id, offset) is monotonically increasing s.t. two different lookups with key (hint_id, offset) will not return different value.
There was a problem hiding this comment.
Monotonicity constraints are now available
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 26 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LookupBusencapsulation to constrain the values loaded fromhint_space.NativeSumcheckto use hint space loading by default. Make opcode's writeback operation optional to reduce cycles.